package cn.growthgate.fgo.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

/**
 * <p>
 * 我的从者羁绊
 * </p>
 *
 * @author GrowthGate
 * @since 2019-05-29
 */
@TableName("t_my_servant_bond")
public class MyServantBond extends Model<MyServantBond> {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键id
	 */
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 我的从者id
	 */
	@NotNull(message = "我的从者id不能为空")
	private Long myServantId;

	/**
	 * 等级
	 */
	private Integer level;

	/**
	 * 值
	 */
	@NotNull(message = "羁绊值不能为空")
	@Min(value = 0, message = "羁绊值不能小于0")
	private Integer value;

	/**
	 * 日期
	 */
	@NotNull(message = "日期不能为空")
	@Past(message = "无法设置未来的羁绊")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date date;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getMyServantId() {
		return myServantId;
	}

	public void setMyServantId(Long myServantId) {
		this.myServantId = myServantId;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "MyServantBond{" + "id=" + id + ", myServantId=" + myServantId + ", level=" + level + ", value=" + value
				+ ", date=" + date + "}";
	}
}
